import requests
from requests.exceptions import HTTPError

try:
    response = requests.get("http://www.baidu.com")
    print(response.raise_for_status())
    print('响应正常，执行下一步')

except HTTPError as e:
    print("HTTP错误:", str(e))